DATA/L1-reflectance2spectra folder contains separate files with reflectance valuesmeta folder contains separate files for each flightline file with metadatain metadata:
The time of the pixel acquition is saved in the meta radiance info. The radiance metadata data frame is all of the flightlines for that year, filtered to preferred location. May include NA areas. Match to reflectance data using pixel location (cellrow, cellcol)
spectra data: * one column for values at each location * wl and band ID * reflectance values are scaled by 1000
Take the interpolated spectra and estimate above water remote sensing reflectance (with and without effects of solar zenith angle) as well as below water remote sensing reflectence. The remote sensing reflectance spectra should be more copmarable? but maybe would still need to be normalized. Effects of glint are not accounted for.
mysite = 'PRLA'
# my_aop_yr = '2019'
# my_loc = pref_locs %>% dplyr::filter(siteID %in% mysite) %>% pull(namedLocation)
my_loc <- c(glue('{mysite}.AOS.buoy.c0'), glue('{mysite}.AOS.buoy.c1'))
my_spectra_fileIDs <- str_detect(spectra_files, glue::glue('{mysite}'))
# my_spectra_fileIDs <- str_detect(spectra_files, glue::glue('{mysite}.*({my_aop_yr})'))
flightlines <- basename(spectra_files[my_spectra_fileIDs]) %>%
purrr::map(~str_split(.x, pattern = "_", simplify = TRUE)[6:7]) %>%
purrr::map_chr(~glue('{.x[[1]]}_{.x[[2]]}'))
flightlines
## [1] "20160629_154247" "20160629_154902" "20160629_155516" "20170621_205644"
## [5] "20190726_151709" "20190726_162146" "20190726_163004" "20190727_152346"
## [9] "20190730_153032" "20200624_161319" "20200624_162051" "20200624_162804"
## [13] "20200624_173036" "20200626_192243" "20200702_171105"
For each flightline, check if there is data then plot
# pick a flightline to work with!
# my_flightline <- flightlines[2]
# need: file vectors created above for a site year (to get flightlines in first place)
source('R/process-flightline-refl.R')
fl_plots <- purrr::map(flightlines, ~process_flightline_refl(.x))
Looks like poor quality data for yellow conditions
fl_data <- fl_plots %>% map(~.x[['data']])
names(fl_data) <- flightlines
fl_data_df <- bind_rows(fl_data, .id = 'flightline_id')
fl_data_long <- fl_data_df %>% tidyr::pivot_longer(cols = c(rho_approx, Rrs1, Rrs2, rrs1, rrs2))
fl_data_long_green <- fl_data_long %>% dplyr::filter(my_clouds %in% c('Green (<10%) cloud cover'))
| flightline_id | my_theta | my_gpstime_hrs |
|---|---|---|
| 20190726_151709 | 49.71099 | 15.33982 |
| 20190726_162146 | 39.87219 | 16.36991 |
| 20190727_152346 | 48.78746 | 15.45125 |
| 20200624_161319 | 36.73749 | 16.31230 |
| 20200624_162051 | 35.64215 | 16.43769 |
| 20200624_173036 | 26.83384 | 17.60777 |
| 20200702_171105 | 29.60470 | 17.23627 |
More plots with full reflectance spectra etc. below
# process_flightline_refl(flightlines[5])
fl_plots[[1]]$plot1
fl_plots[[1]]$plot2
fl_plots[[2]]$plot1
fl_plots[[2]]$plot2
fl_plots[[4]]$plot1
fl_plots[[4]]$plot2
fl_plots[[5]]$plot1
fl_plots[[5]]$plot2
fl_plots[[6]]$plot1
fl_plots[[6]]$plot2
fl_plots[[8]]$plot1
fl_plots[[8]]$plot2
fl_plots[[9]]$plot1
fl_plots[[9]]$plot2
fl_plots[[10]]$plot1
fl_plots[[10]]$plot2
fl_plots[[11]]$plot1
fl_plots[[11]]$plot2
fl_plots[[13]]$plot1
fl_plots[[13]]$plot2
fl_plots[[14]]$plot1
fl_plots[[14]]$plot2
fl_plots[[15]]$plot1
fl_plots[[15]]$plot2